import plugin from "../../../lib/plugins/plugin.js";
import image from "../model/image.js";
import cfg from '../../../lib/config/config.js';
import Cfg from '../model/Cfg.js';

export class example2 extends plugin {
    constructor() {
        super({
            name: 'Person_Help',
            dsc: '人机插件帮助',
            event: 'message',
            priority: -114514,
            rule: [
                {
                    reg: '^(#|/)?(SB|个人|人机|傻逼|sb|煞笔)帮助$',
                    fnc: 'help'
                },

            ]
        });
    }


    async sendHelpImage(e, type) {
        let _path = process.cwd().replace(/\\/g, '/');
        const config = Cfg.getconfig('config', type);
        let { img } = await image(e, 'help', type, {
            saveId: 'help',
            cwd: _path,
            genshinPath: `${_path}/plugins/person-plugin/resources/`,
            helpData: config,
            version: PluginVersion
        });
        e.reply(img);
    }

    async help(e) {
        await this.sendHelpImage(e, 'help');
    }

}
